Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.

[check_ajp] Fix "or die" expressions.#90

Open
ChristopherSchultz wants to merge 1 commit into
bzed:masterfrom
ChristopherSchultz:patch-1
Open

[check_ajp] Fix "or die" expressions.#90
ChristopherSchultz wants to merge 1 commit into
bzed:masterfrom
ChristopherSchultz:patch-1

Conversation

@ChristopherSchultz

Copy link
Copy Markdown

Using || ends up binding too tightly to the operand on the left, so the || xdie expressions never do anything because all of those trailing-parameters to system calls are not undefined.

Changing them to or xdie causes them to actually do what you wanted them to do, which was actually terminate if a system call failed.

I discovered this by using check_ajp across an stunnel setup where the remote server wouldn't properly handshake. The "pong" result ends up being the literal string null for some reason, but the real problem is that sysread is throwing a "Connection reset" error. check_ajp wasn't dying when sysread was throwing an error, so ... it continued and returned an UNKNOWN response.

Using || ends up binding too tightly to the operand on the left, so the `|| xdie` expressions never do anything because all of those trailing-parameters to system calls are not undefined.

Changing them to `or xdie` causes them to actually do what you wanted them to do, which was actually terminate if a system call failed.

I discovered this by using `check_ajp` across an stunnel setup where the remote server wouldn't properly handshake. The "pong" result ends up being the literal string `null` for some reason, but the real problem is that `sysread` is throwing a "Connection reset" error. `check_ajp` wasn't dying when `sysread` was throwing an error, so ... it continued and returned an UNKNOWN response.
@ChristopherSchultz ChristopherSchultz changed the title Fix "or die" expressions. [check_ajp] Fix "or die" expressions. Apr 14, 2021
@waja

waja commented Dec 16, 2021

Copy link
Copy Markdown
Collaborator

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants